﻿using System;
using System.Collections.Generic;
using System.Text;
using AspNetCs.Enumerations;
using AspNetCs.Enumerations.Channel_Enum;
namespace AspNetCs.Bll
{
    public class Channel
    {
        /// <summary>
        /// 频道所属类型
        /// </summary>
        /// <param name="intInfo">参数值</param>
        /// <returns></returns>
        public static string ChannelStr(int intInfo)
        {
            string Result = "";
            switch (intInfo)
            {
                case (int)Channel_Type.cemetery:
                    Result = EnumDescription.GetFieldText(Channel_Type.cemetery);
                    break;

                case (int)Channel_Type.clan:
                    Result = EnumDescription.GetFieldText(Channel_Type.clan);
                    break;

                case (int)Channel_Type.gravestone:
                    Result = EnumDescription.GetFieldText(Channel_Type.gravestone);
                    break;
                case (int)Channel_Type.memorial:
                    Result = EnumDescription.GetFieldText(Channel_Type.memorial);
                    break;
            }

            return Result;
        }

        /// <summary>
        /// 绑定频道所有分类
        /// </summary>
        /// <returns></returns>
        public static Dictionary<int, string> ChannelBind()
        {
            Dictionary<int, string> Active = new Dictionary<int, string>();
            foreach (Channel_Type Chnel in Enum.GetValues(typeof(Channel_Type)))
            {
                Active.Add((int)Chnel, Channel.ChannelStr((int)Chnel));
            }
            return Active;

        }

    }
}
